import fetch from '@/request/fetch'
import qs from "qs"

// 轮播图
export const SwiperAPI = () => fetch.get('/index/banners/travel')

// 游记
export const YoujiAPI = (orderType, currentPage, destId) => fetch.get('/travels/query', { params: { orderType, currentPage, destId } })

// 登录
export const LoginAPI = (params) => fetch.post('/users/login', qs.stringify(params))

// 目的地 热门地区
export const HotRegionAPI = () => fetch.get("/destinations/hotRegion")

// 查询热门地区内的目的地
export const HotRegionSearchAPI = (regionId) => fetch.get("/destinations/search", { params: { regionId } })

// 查询目的地吐司层级
export const ToastsAPI = (destId) => fetch.get('/destinations/toasts', { params: { destId } })

// 旅游攻略列表
export const StrategiesListAPI = (currentPage, themeId, destId) => fetch.get('/strategies/query', { params: { currentPage, themeId, destId, } })

// 旅游攻略主题
export const ThemesListAPI = () => fetch.get('/strategies/themes')

// 旅游攻略详情
export const StrategiesDetailAPI = (id) => fetch.get('/strategies/detail', { params: { id } })

// 旅游攻略详情页查询评论
export const StrategiesDetailCommentsAPI = (currentPage, sid) => fetch.get('/strategies/comments', { params: { currentPage, sid } })

// 旅游攻略详情页添加评论
export const StrategiesAddCommentAPI = (params) => fetch.post('/strategies/addComment', qs.stringify(params))
